package com.baizhi.homework;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class NewsDemo {
    public static void main(String[] args) {
        Map<String,News> map = new HashMap<>();
        News n1 = new News("中国多地雾霾笼罩控制质量再成热议话题","张三","法师打发发大水发大水发大事发生阿萨德大沙发第三方答复打撒");
        News n2 = new News("春节临近北京\"卖房热\"","李四","染色股份色对光反射登记卡拉萨代发更大好气啊叫哦诶u清热哦青蛙发哈从哪进萨达卡拉季不拿放弃阿婆IEUR钱啊问哈");
        News n3 = new News("春节临近北京\"卖房热\"","王五","afsdflakjsdfuuj89uq23wefhdskajlbcjsvaxkewpqoiruad;sljfnm");

        map.put(n1.getTitle(),n1);
        map.put(n2.getTitle(),n2);
        map.put(n3.getTitle(),n3);

       // System.out.println(map);

        Set<Map.Entry<String, News>> entries = map.entrySet();
        for (Map.Entry<String, News> entry : entries) {
            String key = entry.getKey();
            News value = entry.getValue();
            System.out.println(key+":"+value);
        }
    }
}
